package com.zzyl.utils;

import java.util.HashSet;
import java.util.Random;
import java.util.Set;

public class RandomNicknameGenerator {


    private static final String[] NAMES = {"雁玉", "冷卉", "紫山", "千琴", "恨天", "傲芙", "盼山", "怀蝶", "冰兰", "问旋",
            "从南", "白易", "问筠", "如霜", "半芹", "寒雁", "怜云", "寻文", "谷雪", "乐萱",
            "涵菡", "海莲", "傲蕾", "青槐", "冬儿", "易梦", "惜雪", "宛海", "之柔", "夏青"};

    public static String generateRandomNickname() {
        Random random=new Random();
        String name = NAMES[random.nextInt(NAMES.length)];
        String randomString = generateRandomString(4, random);
        return name + randomString;
    }

    private static String generateRandomString(int length, Random random) {
        String characters = "abcdefghijklmnopqrstuvwxyz";
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < length; i++) {
            int index = random.nextInt(characters.length());
            sb.append(characters.charAt(index));
        }
        return sb.toString();
    }
}
